package com.android.superobstacleavoider;

public class Vector2 {
	public float X;
	public float Y;

	public static final Vector2 ZERO = new Vector2(0.0f, 0.0f);

	public Vector2() {
		X = 0.0f;
		Y = 0.0f;
	}

	public Vector2(float a_x, float a_y) {
		X = a_x;
		Y = a_y;
	}

	public Vector2 set(float a_x, float a_y) {
		X = a_x;
		Y = a_y;
		return this;
	}

	public Vector2 set(Vector2 a_vector) {
		return this.set(a_vector.X, a_vector.Y);
	}

	public Vector2 add(float a_x, float a_y) {
		return this.set(this.X + a_x, this.Y + a_y);
	}

	public Vector2 add(Vector2 a_vector) {
		return this.add(a_vector.X, a_vector.Y);
	}

	public Vector2 add(float a_value) {
		return this.set(this.X + a_value, this.Y + a_value);
	}

	public Vector2 sub(Vector2 a_vector) {
		return this.sub(a_vector.X, a_vector.Y);
	}

	public Vector2 sub(float a_x, float a_y) {
		return this.set(this.X - a_x, this.Y - a_y);
	}

	public Vector2 sub(float a_value) {
		return this.set(this.X - a_value, this.Y - a_value);
	}

	public Vector2 mul(float a_value) {
		return this.set(this.X * a_value, this.Y * a_value);
	}
}
